package com.sz.biz.trade.ord.service.impl;

import com.sz.biz.trade.ord.entity.TrdOrderTracking;
import com.sz.biz.common.AbstractVersionEntityService;
import com.sz.biz.trade.ord.service.TrdOrderTrackingService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.text.ParseException;

/**
 * Function: 贸易订单日志服务<br>
 * Author: jifeixing <br>
 * Date: 2017-07-30 14:10:00
 */
@Service("trdOrderTrackingService")
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class TrdOrderTrackingServiceImpl extends AbstractVersionEntityService implements TrdOrderTrackingService {

    @Override
    protected String getMapperNamespace() {
        return "TrdOrderTrackingMapper";
    }


    /**
     * 保存
     * @param orderNo
     * @param fromStatus
     * @param toStatus
     * @param message
     * @param updateUserId
     * @throws ParseException
     */
    @Override
    public void save(String orderNo, String fromStatus, String toStatus, String message, Integer updateUserId){
        TrdOrderTracking trdOrderTracking = new TrdOrderTracking();
        trdOrderTracking.setOrderNo(orderNo);
        trdOrderTracking.setFromStatus(fromStatus);
        trdOrderTracking.setToStatus(toStatus);
        trdOrderTracking.setMessage(message);
        trdOrderTracking.setUpdateUserId(updateUserId);
        dao.save(getSqlName("insertSelective"), trdOrderTracking);
    }
}
